package com.base.cn.platform.os.entity.course.cloud.sms;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

@Data
@EqualsAndHashCode(callSuper = false)
public class CsySmsService<T> {

    private int status;
    private List<T> data;
    private int total;
    private String info;
    private Map<String,String> page;

    public List<T> getData() {
        if (data == null) {
            return Collections.emptyList();
        }
        return data.stream()
                .filter(Objects::nonNull)
                .collect(Collectors.toList());
    }
}
